package main

import (
	"google.golang.org/grpc"
	"log"
	"mxshop_srvs/handler"
	"mxshop_srvs/proto"
	"net"
)

var port = ":50001"

func main() {

	conn := grpc.NewServer()

	lis, err := net.Listen("tcp", port)
	if err != nil {
		log.Fatalf("failed to listen: %v", err)
	}

	proto.RegisterUserServer(conn, &handler.UserServer{})

	log.Println("Serving gRPC on 0.0.0.0" + port)
	if err = conn.Serve(lis); err != nil {
		log.Fatalf("failed to serve: %v", err)
	}

}
